import json

def get_stored_username():
	file_name = "username.json"
	try:
		with open(file_name) as file:
			username = json.load(file)
	except FileNotFoundError:
		username = None

	return username

def get_new_username():
	username = input("请输入用户名： ")
	file_name = "username.json"
	with open(file_name, 'w') as file:
		json.dump(username, file)
	return username

username = get_stored_username()
if username:
	info = input(f"{username} 用户名是否正确（Y/N）")

if not username or info == 'N':
	username = get_new_username()
	print(f"我已经记录了新的用户名字{username}")